package com.dkd.manage.service.impl;

import java.util.List;
import com.dkd.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.dkd.manage.mapper.StockLogMapper;
import com.dkd.manage.domain.StockLog;
import com.dkd.manage.service.IStockLogService;

/**
 * 库存变动日志Service业务层处理
 * 
 * @author LQL
 * @date 2025-04-22
 */
@Service
public class StockLogServiceImpl implements IStockLogService 
{
    @Autowired
    private StockLogMapper stockLogMapper;

    /**
     * 查询库存变动日志
     * 
     * @param logId 库存变动日志主键
     * @return 库存变动日志
     */
    @Override
    public StockLog selectStockLogByLogId(Long logId)
    {
        return stockLogMapper.selectStockLogByLogId(logId);
    }

    /**
     * 查询库存变动日志列表
     * 
     * @param stockLog 库存变动日志
     * @return 库存变动日志
     */
    @Override
    public List<StockLog> selectStockLogList(StockLog stockLog)
    {
        return stockLogMapper.selectStockLogList(stockLog);
    }

    /**
     * 新增库存变动日志
     * 
     * @param stockLog 库存变动日志
     * @return 结果
     */
    @Override
    public int insertStockLog(StockLog stockLog)
    {
        stockLog.setCreateTime(DateUtils.getNowDate());
        return stockLogMapper.insertStockLog(stockLog);
    }

    /**
     * 修改库存变动日志
     * 
     * @param stockLog 库存变动日志
     * @return 结果
     */
    @Override
    public int updateStockLog(StockLog stockLog)
    {
        stockLog.setUpdateTime(DateUtils.getNowDate());
        return stockLogMapper.updateStockLog(stockLog);
    }

    /**
     * 批量删除库存变动日志
     * 
     * @param logIds 需要删除的库存变动日志主键
     * @return 结果
     */
    @Override
    public int deleteStockLogByLogIds(Long[] logIds)
    {
        return stockLogMapper.deleteStockLogByLogIds(logIds);
    }

    /**
     * 删除库存变动日志信息
     * 
     * @param logId 库存变动日志主键
     * @return 结果
     */
    @Override
    public int deleteStockLogByLogId(Long logId)
    {
        return stockLogMapper.deleteStockLogByLogId(logId);
    }
}
